#pragma once

class BufferKeeper
{
	int mCapacity;
	void* mBuffer;
public:

	BufferKeeper(int initialReservation, int sizeOfElement);
	~BufferKeeper();

	template<typename T>
	void NewBufferWithCapacity(int capacity, T** outBufferPtr);

private:
	void AllocateSize(int capacity);
};

template<typename T>
void BufferKeeper::NewBufferWithCapacity(int capacity, T** outBufferPtr)
{
	AllocateSize(capacity * sizeof(T));
	*outBufferPtr = reinterpret_cast<T*>(mBuffer);
}